<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:52:"E:\WWW\waimai/app/wechat/order\view\order\index.html";i:1503135515;s:54:"E:\WWW\waimai/app/wechat/order\view\template\base.html";i:1502523229;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <title>外卖</title>
    <link rel="stylesheet" href="__STATIC__/css/mui.min.css">
    <link rel="stylesheet" href="__STATIC__/css/ks.css">
    
    <script>
        var require_path = "__STATIC__/app";
    </script>
    <script src="__STATIC__/app/plugin/wechat/weixin.js"></script>
    <script src="__STATIC__/app/require.js"></script>
    <script src="__STATIC__/app/require.config.js"></script>
    <script src="__STATIC__/app/plugin/jquery-3.2.1.min.js"></script>
    <script src="__STATIC__/app/plugin/mui/mui.min.js"></script>
    
</head>
<body>


    <footer class="footer">
    <ul>
        <li>
            <a href="<?php echo url('/shop/Shop/index'); ?>">
                <i class="iconfont icon-meishi"></i>
                <p>外卖</p>
            </a>
        </li>
        <!--<li>-->
        <!--<a href="">-->
        <!--<i class="iconfont icon-fujin"></i>-->
        <!--<p>附近</p>-->
        <!--</a>-->
        <!--</li>-->
        <li  class="active">
            <a href="javascript:; ">
                <i class="iconfont icon-dingdantianxiexianxing"></i>
                <p>订单</p>
            </a>
        </li>
        <li>
            <a href="<?php echo url('/cart/Cart/index'); ?>">
                <i class="iconfont icon-gouwuche"></i>
                <p>购物车</p>
            </a>
        </li>
        <li>
            <a href="<?php echo url('/user/Index/index'); ?>">
                <i class="iconfont icon-wode"></i>
                <p>我的</p>
            </a>
        </li>
    </ul>
</footer>


<header class="header">
    <div>
        <a class="back" href="<?php echo url('shop/shop/index'); ?>"><i class="iconfont icon-zuoyoujiantou-copy-copy-copy"></i></a>
        订单管理
    </div>
</header>
<div class="pages">
    <div id="tab-head" class="tab-head">
        <ul>
            <li :class="[0==t_index? 'active' : '']" @tap="tab_0(0)"><a>全部</a></li>
            <li :class="[1==t_index? 'active' : '']" @tap="tab_1(1)"><a>待付款</a></li>
            <li :class="[2==t_index? 'active' : '']" @tap="tab_2(2)"><a>待配送</a></li>
            <li :class="[3==t_index? 'active' : '']" @tap="tab_3(3)"><a>待收货</a></li>

        </ul>
    </div>
    <div class="tab-body">
        <div id="refreshContainer" class="mui-scroll-wrapper">
            <div class="mui-scroll">
                <div id="order_div" class="list-form other has-b">
                    <template v-for="item in items">
                        <ul  v-for="vo in item">
                            <li @tap.stop="detail(vo.id)">
                                <div>
                                    订单号： {{vo.order_sn}}
                                    <span  class="pull-right" style="color: #C2C2C2">{{vo.order_time}}</span>
                                </div>
                                <div v-if='(vo.flag_pay==0&&vo.flag_status.value==0&&vo.flag_delivery!=1)' class="color-primary">
                                    未付款
                                </div>
                                <div v-else class="color-primary">
                                    {{vo.flag_status.text}}
                                </div>
                            </li>
                            <li @tap.stop="detail(vo.id)" class="goods-list small">
                                <ul>
                                    <li v-for="ivo in vo.order_items">
                                        <div class="img"><img :src="ivo.logo" height="441"
                                                              width="500"/></div>
                                        <div class="text">
                                            <div class="title">{{ivo.store_name}}</div>
                                            <p class="color-primary">小计：￥{{ivo.pay_amount}}</p>
                                        </div>
                                    </li>
                                    <!--<li>-->
                                    <!--<div class="img"><img src="../../../../public/wechat/static/image/timo.jpg" height="441"-->
                                    <!--width="500"/></div>-->
                                    <!--<div class="text">-->
                                    <!--<div class="title">商家名称</div>-->
                                    <!--<p class="color-primary">￥18.8</p>-->
                                    <!--</div>-->
                                    <!--</li>-->
                                </ul>
                            </li>
                            <li style="min-height: 43px;">
                                <div class="absmiddle-left">
                                    <div>合计：<span class="color-primary">￥{{vo.pay_amount}}</span></div>
                                </div>
                                <div class="text-right">
                                    <a  v-if='(vo.flag_pay==0&&vo.flag_status.value==0&&vo.flag_delivery!=1)'
                                        @tap.stop="order_pay(vo.id,vo.send_status)" class="btn color-primary">立即支付</a>
                                    <a v-if="(vo.flag_status.value==1||vo.flag_status.value==6)" class="btn color-primary" @tap.stop="take_order(vo.id)">确认收货</a>
                                    <a v-if='(vo.flag_pay==0&&vo.flag_status.value==0)' @tap.stop="cancel_order(vo.id)" class="btn " style="color: grey;">取 消</a>
                                </div>
                            </li>
                        </ul>
                    </template>
                </div>
            </div>
            <div class="tip-icon" id="tip-icon" style="display: none;"> <i class="iconfont icon-dingdan"></i> <p>暂无订单</p> </div>
        </div>
    </div>
</div>


</body>
<script>
    if(document.querySelector('.goback')!=null){
        document.querySelector('.goback').addEventListener('tap', function () {
            history.back();
        })
    }
    host="<?php echo \think\Request::instance()->host(); ?>";
    se_url="<?php echo \think\Request::instance()->baseUrl(); ?>";

    if(se_url=="/wechat.php"){
        current_url= 'http://'+window.location.host+se_url+'/index/index/index'+'?parent_id='+"<?php echo $account['id']; ?>";
    }else{
        current_url='http://'+window.location.host+"<?php echo \think\Request::instance()->baseUrl(); ?>"+'?parent_id='+"<?php echo $account['id']; ?>";
    }
    console.log(current_url)

    appId='<?php echo $js_sdk['appid']; ?>' ; // 必填，公众号的唯一标识
    timestamp= '<?php echo $js_sdk['time']; ?>';// 必填，生成签名的时间戳
    nonceStr= '<?php echo $js_sdk['nonceStr']; ?>'; // 必填，生成签名的随机串
    signature= '<?php echo $js_sdk['signature']; ?>';// 必填，签名，见附录1
    jsApiList= [ 'scanQRCode','onMenuShareTimeline','onMenuShareAppMessage','onMenuShareQQ','chooseImage','uploadImage', 'checkJsApi', 'openLocation', 'getLocation']; // 必填，需要使用的JS接口列表，所有JS接口列表见附录2

    wx.config({
        debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
        appId:appId , // 必填，公众号的唯一标识
        timestamp: timestamp, // 必填，生成签名的时间戳
        nonceStr: nonceStr, // 必填，生成签名的随机串
        signature: signature,// 必填，签名，见附录1
        jsApiList: jsApiList // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
    });

    wx.checkJsApi({
        jsApiList: [ 'scanQRCode','onMenuShareTimeline','onMenuShareAppMessage','onMenuShareQQ','chooseImage','uploadImage', 'checkJsApi', 'openLocation', 'getLocation'],
        success: function (res) {
            // alert(JSON.stringify(res));
            // alert(JSON.stringify(res.checkResult.getLocation));
            if (res.checkResult.getLocation == false) {
                alert('你的微信版本太低，不支持微信JS接口，请升级到最新的微信版本！');
                return;
            }
        }
    });
    wx.ready(function(){
        var shareData = {
            title: '外卖',            //朋友圈文案（朋友圈没有标题）
            desc: '钦州外卖就系快',
            link:current_url,
            imgUrl:'http://wm.qzzm.com/public/wechat/static/image/default.png',
            success: function () {
                mui.toast('分享成功')
            },
            cancel: function () {
                mui.toast('您已取消分享')
            }
        };
        wx.onMenuShareTimeline(shareData);
        wx.onMenuShareAppMessage(shareData);
        wx.onMenuShareQQ(shareData);
        wx.onMenuShareWeibo(shareData);
        wx.onMenuShareQZone(shareData);
    });
</script>

<script>
    var list_url = "<?php echo url('order/Order/index'); ?>";
    var order_pay_url = "<?php echo url('order/Order/pay'); ?>";
    var cancel_order_url = "<?php echo url('order/Order/cancel_order'); ?>";
    var take_order_url = "<?php echo url('order/Order/take_order'); ?>";
    var detail_url = "<?php echo url('order/Order/detail'); ?>";
    var c_url = "<?php echo $c_url; ?>";
    require(['order/index']);
</script>

</html>